In three-dimensional graphics, a graphics engine generates a two-dimensional image when a three-dimensional object is viewed from a predetermined visual point, based on three-dimensional data on the three-dimensional object, and writing data on each pixel of the two-dimensional image in a memory, whereby two-dimensional image data is generated. The image data stored in the memory is read by a display engine so as to be displayed on a display device.
In this image processing apparatus, DRAM is normally used as a memory for writing image data. DRAM has characteristics where memory access to continuous addresses is fast, but memory access to discontinuous addresses is slow. In concrete terms, a DRAM has a processing unit called a “page”, and access within a same (continuous addresses) is fast, but accessing different pages (discontinuous addresses) generates a processing called a “page miss”. If a page miss is generated, a DRAM controller must activate a new word line, and read data from the memory cell, during which the DRAM cannot be accessed for new reading.
However a three-dimensional object is normally drawn as a set of small lines and triangles, therefore a large quantity of discontinuous memory accesses is generated when the three-dimensional object is drawn in the DRAM, and memory access efficiency drops considerably.
As a method for improving this problem, a tiling architecture is known. According to the tiling architecture, the image processing apparatus divides a drawing space into a predetermined size (e.g. 8×8 pixels) of tiles, and performs drawing processing for all the graphics having pixels in a tile, using an internal memory, such as an SRAM, and writes the image data generated in the internal memory to an external memory (Japanese Translation of PCT Application No. 2002-529865). Since the image data is written to the external memory in tile units, DRAM is continuously accessed, and access efficiency improves.
According to the tiling architecture, however, the graphics engine generates drawing parameters having an increment value of each side of a polygon and an increment value of a span, and determines a polygon having a pixel in a tile, out of all the polygons, based on the vertex parameters of the polygon (e.g. a coordinate, depth, parameter value) for all the drawing target polygons for each tile. As a consequence, drawing parameter generation processing is required for all the polygons for each tile, and processing volume increases.
A possible method to prevent this problem is generating drawing parameters for all the drawing target polygons, and writing this data to an external memory, and reading the drawing parameters from the external memory when the drawing processing of a tile is performed, and determining a polygon having a pixel in the tile. According to this method, however, the graphics engine must access the external memory every time processing to read or write the drawing parameters is performed.